<template>
  <div  v-loading="loading"  v-if="discloseData.length>0">
    <a-card class="mb20"  v-for="item in discloseData" :key="item.id">
      <titleName title="交底记录信息" />
      <a-form-model ref="ruleForm" :model="item" :label-col="{ span: 6 }" :wrapper-col="{ span: 16 }">
        <a-row :gutter="24">
          <a-col :md="8" :sm="8">
            <a-form-model-item label="现行版本：" prop="currentVersion">
              <BaseInput v-model.trim="item.currentVersion" :max-length="30" placeholder="请输入" disabled />
            </a-form-model-item>
          </a-col>
          <a-col :md="8" :sm="8">
            <a-form-model-item label="编制人员：" prop="programmer">
              <BaseInput v-model.trim="item.programmer" :max-length="30" placeholder="请输入" disabled />
            </a-form-model-item>
          </a-col>
          <a-col :md="8" :sm="8">
            <a-form-model-item label="会议地点：" prop="meetingPlace">
              <BaseInput v-model.trim="item.meetingPlace" :max-length="30" placeholder="请输入" disabled />
            </a-form-model-item>
          </a-col>
          <a-col :md="8" :sm="8">
            <a-form-model-item label="会议时间：" prop="startTime">
              <a-date-picker disabled v-model="item.startTime" :show-time="{ format: 'HH:mm' }" format="YYYY-MM-DD" placeholder="请输入" @change="(date, dateString) => getTime(date, dateString, 'form', 'startTime')" />
            </a-form-model-item>
          </a-col>
          <a-col :md="8" :sm="8">
            <a-form-model-item label="交底人：" prop="confessUserId">
              <SelectPersonByProject disabled v-model="item.confessUserId" :project-id="formData.projectId" :show-search="true" mode="combobox" placeholder="请选择" option-label-prop="children" />
            </a-form-model-item>
          </a-col>
          <a-col :md="24" :sm="24" v-if="formData.isProSub">
            <a-form-model-item label="主要参会人员：" prop="mainParticipants">
              <BaseTextarea v-model.trim="item.mainParticipants" :max-length="300" placeholder="请输入" disabled />
            </a-form-model-item>
          </a-col>
          <a-col :md="24" :sm="24" v-if="!formData.isProSub">
            <a-form-model-item label="参会者选择：" prop="meetingEmployeeVOList">
              <!-- 表格 -->
              <a-table :columns="columnsEmployee" :data-source="item.meetingEmployeeVOList || []" bordered> </a-table>
            </a-form-model-item>
            <!-- </a-col> -->
          </a-col>
          <a-col :md="24" :sm="24" v-if="formData.isProSub">
            <a-form-model-item label="会议纪要：" prop="meetingSummary">
              <BaseTextarea v-model.trim="item.meetingSummary" :max-length="300" placeholder="请输入" disabled />
            </a-form-model-item>
          </a-col>
          <a-col :md="24" :sm="24">
            <a-form-model-item label="现场照片">
              <upload-list :businessCode="'BM24'" :uploadArrys.sync="item.sitPhotoList" uploadType="image" :editModel="2" multiple disabled></upload-list>
            </a-form-model-item>
          </a-col>
          <a-col :md="24" :sm="24" v-if="!formData.isProSub">
            <a-form-model-item label="主要内容：" prop="meetingSummary">
              <BaseTextarea v-model.trim="item.meetingSummary" :max-length="300" placeholder="请输入" disabled />
            </a-form-model-item>
          </a-col>
          <a-col :md="24" :sm="24">
            <a-form-model-item label="附件上传">
              <upload-list :businessCode="'BM24'" :uploadArrys.sync="item.fileList" :editModel="2" multiple disabled></upload-list>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </a-card>
  </div>
</template>
<script>
import SelectPersonByProject from '@/components/Select/SelectPersonByProject' // 分公司
import UploadList from '@/components/UploadList'
import dialogEdit from './dialogEdit.vue' // 表单弹窗
import SelectPerson from '@/components/BComponents/BSelectPerson'
import { getTechnicalProgramConfessList } from '@/api/office/conference'
const columnsEmployee = [
  {
    title: '员工名称',
    dataIndex: 'name'
  },

  {
    title: '电话号码',
    dataIndex: 'phone'
  },

  {
    title: '操作',
    dataIndex: 'actions',
    width: '100px',
    scopedSlots: { customRender: 'actions' }
  }
]
export default {
  components: {
    SelectPersonByProject,
    UploadList,
    dialogEdit,
    SelectPerson
  },
  props: {
    formData: {
      type: Object,
      default: {}
    }
  },
  data() {
    return {
      columnsEmployee,
      loading: false,
      visible: false,
      discloseData: []
    }
  },
  methods: {
    getTime(date, dateString, type, name) {
      this[type][name] = dateString
      console.log(this[type][name])
    },
    getDetailsFn(id) {
      this.loading = true;
      getTechnicalProgramConfessList({ id: id }).then((res) => {
        if (res[1].code == 200) {
          this.loading = false;
          this.discloseData = res[1].data
        }
      })
    },
    handleClose() {
      this.$multiTab.close(this.$route.fullpath)
    }
  },
  mounted() {
    if (this.formData.id) {
      this.getDetailsFn(this.formData.id)
    }
  }
}
</script>